package com.soap.desensitize.factory.posterity;

import com.soap.desensitize.encry.IDesensitization;
import com.soap.desensitize.exception.factory.StrategyFactoryException;
import com.soap.desensitize.posterity.json.AbstractJsonPosterity;
import com.soap.desensitize.posterity.json.ObjcetToJsonPosterity;

/**
 * @desc 数据转Json脱敏子孙后代类工厂
 */
public class ObjToJsonFactory {

    /**
     * @desc 根据类路径生产字符串脱敏的功能拓展类
     * @return
     * @throws InstantiationException
     * @throws IllegalAccessException
     * @throws StrategyFactoryException
     */
    public static AbstractJsonPosterity create() {
        return ObjcetToJsonPosterity.getInstance();
    }
    /**
     * @desc 创建
     * @param encry
     * @return
     */
    public static AbstractJsonPosterity create(IDesensitization encry) {
        AbstractJsonPosterity posterity = null;

        posterity = create();

        posterity.setEncry(encry);
        return posterity;
    }
}
